<!DOCTYPE html>
<html>
<head>
    <title>预约信息</title>
    <%- include('./_global/appendJs') %>

</head>
<style>
.doctor-img{
    width: 3.9rem;
    height: 3.9rem;
    float: left;
}
</style>


<body>
<section class="page-wrap yyxx-box">
    <header class="header-box grey fixed header">
        <div class="header-content">
            <div class="left-tool">
                <a class="back" href="javascript:void(0)"><i class="iconfont icon-back"></i></a>
            </div>
            <div class="title">预约信息</div>
        </div>
    </header>
    <div class="first-box">
        <i class="doctor-img"></i>
        <div class="text-box">
            <p>
                <span class="name-span doctor" name="docName">龚海荣</span>
                <span class="doctor" name="docTitle">副主任医师</span>
            </p>
            <p>
                <span class="doctor" name="hosName">万达医院</span>
                <span class="doctor" name="depName">呼吸科</span>
            </p>
        </div>
    </div>
    <div class="second-list-box">
        <ul>
            <li>
                <span class="text-left">就诊时间</span>
                <span class="text-right scheduleDate"></span>
            </li>
            <li>
                <span class="text-left">门诊类型</span>
                <span class="text-right regType"></span>
            </li>
            <!--<li>-->
                <!--<span class="text-left">挂号费用</span>-->
                <!--<span class="text-right"><span class="yellow-text visitCost">36元</span></span>-->
            <!--</li>-->
        </ul>
    </div>
    <div class="last-box">
        <a>
            <span class="text-left">就诊人</span>
            <span class="text-right">
                <span class="blue-text" id="jzr" >添加就诊家人</span>
               <!--  <i class="arrow-right"></i> -->
            </span>
        </a>
    </div>


    <div class="qd-btn-box">
        <a class="qd-btn" href="javascript:void(0);">确定预约</a>
    </div>
</section>
<script src="/static/lib/forweb.js"></script>
<script src="/quickJs/scripts/swiper/3.4.2/js/swiper.min.js"></script>
<script src="/static/js/<%=type%>/pageUrl.js"></script>
<script src="/static/js/<%=type%>/yygh.js"></script>
<script type="text/javascript">


    var page_yyInfo = (function($, page_yyInfo) {



        /**加载视图*/
        function initView(){
            /**ui脚本*/
            $('.pay-list-box').find("li").click(function(){
                if( ! $(this).hasClass('active')){
                    $(this).addClass('active').siblings().removeClass('active');
                }else{
                    $(this).removeClass('active');
                }
            })
        }

        /**加载数据*/
        function initData(){
            /**加载医生信息*/
            var docInfo = StoreCache.getCache("YYGH_YSINFO");
            var hosInfo = StoreCache.getCache("YYGH_HOSINFO");
            docInfo['hosName'] = hosInfo.hosName;
            if(docInfo["orderType"] == "2"){
               // $(".first-box").find(".name-span").parent().hide();
               $(".first-box").find(".doctor[name='docName']").text("");
               $(".first-box").find(".doctor[name='docTitle']").text("");
                $(".first-box").find(".doctor[name='hosName']").text(docInfo["hosName"]);
                $(".first-box").find(".doctor[name='depName']").text(docInfo["deptName"]);
                 var docImgUrl = "/static/images/icon_ptmz.png";
                
                $(".doctor-img").attr("style","background:url('"+docImgUrl+"') no-repeat;background-size: 100% 100%;");
            }else{

                 $(".first-box").find(".doctor").each(function(){
                $(this).text(docInfo[$(this).attr("name")]);
                });
                var docImgUrl = docInfo["docImgUrl"];
                if(!docInfo["docImgUrl"]){
                    docImgUrl ="/static/images/doctor_image.jpg";
                }
                $(".doctor-img").attr("style","background:url('"+docImgUrl+"') no-repeat;background-size: 100% 100%;");

            }

           
            /**加载号源信息*/
            var hyInfo = StoreCache.getCache("YYGH_HYINFO")?StoreCache.getCache("YYGH_HYINFO"):docInfo;
            $(".scheduleDate").text(hyInfo["scheduleDate"]);
            $(".regType").text(page_yyInfo.getRegType(hyInfo["regType"]));
            $(".visitCost").text(page_yyInfo.getVisitCost(hyInfo["visitCost"]));
        }


        /**获取门诊类型*/
        function getRegType(regType){
            var value = "";
            if(regType == "100"){
                value = "普通门诊";
            }
            else if(regType == "101"){
                value = "专科门诊";
            }
            else if(regType == "102"){
                value = "专家门诊";
            }
            else if(regType == "103"){
                value = "特需门诊";
            }
            else if(regType == "104"){
                value = "专病门诊";
            }
            else if(regType == "999"){
                value = "其它门诊";
            }
            return value;
        }

        function getVisitCost(visitCost){
            var value = "0";
            if(!StringUtils.isEmpty(visitCost)){
                value = visitCost;
            }
            return value+"元";
        }
        var cfg_def = {
            initView: initView,
            initData: initData,
            getRegType: getRegType,
            getVisitCost: getVisitCost,
        }

        page_yyInfo.init = function(cfg){
            $.extend(page_yyInfo, cfg_def, cfg);
            page_yyInfo.initData();
            page_yyInfo.initView();
            yyghSetControl();

        }

        return page_yyInfo;
    })(jQuery, {});
    
</script>
<!-- start支付引用。需传入支付成功后跳转的url.还有擦掉按钮之后的行为。需要调用toGetPay 传入获取订单相关信息的参数 -->
<%- include('./_global/toPay.ejs') %>
<!-- end -->
</body>
</html>



